{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# `regex` workflow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "%reload_ext autoreload\n",
    "%autoreload 2\n",
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import re"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Jeremy Howard is the guest lecturer for Lesson 9! <br>\n",
    "\n",
    "#### In the video, he gives a three-part lesson plan: \n",
    "    * regex workflow\n",
    "    * svd\n",
    "    * transfer learning. \n",
    "    \n",
    "Jeremy mentions that he uses `regex` every day in his work, and that it is essential for machine learning practitioners to develop a working knowledge of `regex`. Since we've already done deep dives into `svd` and into `transfer learning`, we'll focus on the `regex` part of this video, `from 1:50 to 21:29`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### A simple `regex` exercise\n",
    "#### To illustrate the power of `regex` and familiarize us with the way he works, Jeremy poses the following problem: <br>Let's extract all the phone numbers from the Austin Public Health Locations database and create a list of the phone numbers in the standard format `(ddd) ddd dddd`. He shows how to use `vim` to accomplish this task.\n",
    "Let's listen to Jeremy for the next 20 minutes or so:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/5gCQvuznKn0?start=110\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import HTML\n",
    "\n",
    "# Play youtube video\n",
    "HTML('<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/5gCQvuznKn0?start=110\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Some of the takeaways from the video, paraphrased:\n",
    "1. A neccessary but not sufficient condition for success<br>\n",
    "What is the greatest difference between people who succeed and people who do not? It's entirely about tenacity. If you are willing to focus on the task and keep trying you have a good chance of succeeding. \n",
    "\n",
    "2. Workflow<br>\n",
    "Work in an interactive environment, such as `vim`, or `jupyter notebook`, so you can try things get immediate feedback, revise, and progress toward a solution. \n",
    "\n",
    "3. Debugging<br>\n",
    "When your code fails, remember that the computer is doing exactly what you asked. A good general approach is to break the code up into smaller parts, then run it again, and find out which part doesn't work.\n",
    "\n",
    "4. Humility<br>\n",
    "It's never \"I think the problem in the code is X\". A better approach is to start with the working assumption \"I am an idiot, and I don't understand why things aren't working\". Be willing to start from scratch and check every little step."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### OK, let's get to work on our task. We'll use `jupyter notebook` as our interactive environment."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. Get the Austin Public Health Locations database\n",
    "#### https://data.austintexas.gov/Health-and-Community-Services/Austin-Public-Health-Locations/6v78-dj3u/data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = 'C:/Users/cross-entropy/.fastai/data/Austin_Public_Health_Locations'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Read the data into a pandas dataframe. \n",
    "From the `Phone Number` column, we see that the phone numbers are in the format `ddd-ddd-dddd`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Facility Name</th>\n",
       "      <th>Street Address</th>\n",
       "      <th>Zip Code</th>\n",
       "      <th>Hours</th>\n",
       "      <th>Website</th>\n",
       "      <th>Phone Number</th>\n",
       "      <th>Other Phone</th>\n",
       "      <th>Building ID</th>\n",
       "      <th>Ownership Status</th>\n",
       "      <th>Owner</th>\n",
       "      <th>Occupying Division</th>\n",
       "      <th>Occupancy Type</th>\n",
       "      <th>Sq. Ft.</th>\n",
       "      <th>Year Built</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>Bastrop WIC Clinic</td>\n",
       "      <td>443 Texas Highway 71\\nBastrop, Texas 78602\\n(3...</td>\n",
       "      <td>78602</td>\n",
       "      <td>Monday 7:30am to 7pm, closed 12 noon to 1pm; T...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>BAS</td>\n",
       "      <td>Lease</td>\n",
       "      <td>The Marketplace at Bastrop</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>1400.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>Vital Records</td>\n",
       "      <td>7201 Levander Loop, Building C\\nAustin, Texas\\...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Monday to Friday, 8am to 4:30pm</td>\n",
       "      <td>https://austintexas.gov/birthcertificates</td>\n",
       "      <td>512-972-4784</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>Manor WIC Clinic</td>\n",
       "      <td>600 West Carrie\\nManor, Texas 78653\\n(30.34016...</td>\n",
       "      <td>78653</td>\n",
       "      <td>Thursday 9am to 2:30pm, closed 12 noon to 12:30pm</td>\n",
       "      <td>http://www.austintexas.gov/department/manor-wi...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>MAN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Travis County</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>1700.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>St. Johns WIC Clinic</td>\n",
       "      <td>7500 Blessing Avenue\\nAustin, Texas 78752\\n(30...</td>\n",
       "      <td>78752</td>\n",
       "      <td>Monday and Tuesday 7:30 a.m. to 7 p.m., closed...</td>\n",
       "      <td>http://www.austintexas.gov/department/st-johns...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>SJC</td>\n",
       "      <td>Lease</td>\n",
       "      <td>Austin Independent School Center</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>9559.0</td>\n",
       "      <td>2001.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>Betty Dunkerley Health Campus Building B</td>\n",
       "      <td>7201 Levander Loop\\nAustin, Texas 78702\\n(30.2...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Sunday - Saturday 7:00am to 7:00pm</td>\n",
       "      <td>NaN</td>\n",
       "      <td>512-972-5010</td>\n",
       "      <td>NaN</td>\n",
       "      <td>BDCB</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Epidemiology and Public Health Preparedness, O...</td>\n",
       "      <td>Offices</td>\n",
       "      <td>2190.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>Northwest WIC Clinic</td>\n",
       "      <td>8701 Research Blvd, Suite A\\nAustin, Texas 787...</td>\n",
       "      <td>78758</td>\n",
       "      <td>Monday and Tuesday 7:30am to 7:00pm, closed 12...</td>\n",
       "      <td>http://www.austintexas.gov/department/northwes...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NWW</td>\n",
       "      <td>Lease</td>\n",
       "      <td>Van Family Real Estate Partnership, Ltd</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>4200.0</td>\n",
       "      <td>1993.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>Rutherford Campus</td>\n",
       "      <td>1520 Rutherford Lane, Bldg 1\\nAustin, Texas 78...</td>\n",
       "      <td>78754</td>\n",
       "      <td>Monday and Wednesday 7:45am to 11:30am; Tuesda...</td>\n",
       "      <td>https://austintexas.gov/department/environment...</td>\n",
       "      <td>512-978-0300</td>\n",
       "      <td>NaN</td>\n",
       "      <td>RLC</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Environmental Health Services</td>\n",
       "      <td>Offices</td>\n",
       "      <td>2500.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>Montopolis Recreation Community Center</td>\n",
       "      <td>1200 Montopolis Dr.\\nAustin, Texas 78741\\n(30....</td>\n",
       "      <td>78741</td>\n",
       "      <td>Monday - Thursday: 11 AM - 9 PM, Friday 11 AM ...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12-978-2300</td>\n",
       "      <td>NaN</td>\n",
       "      <td>MRCC</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>Blackland Neighborhood Center</td>\n",
       "      <td>2005 Salina St\\nAustin, Texas 78722\\n(30.28075...</td>\n",
       "      <td>78722</td>\n",
       "      <td>Monday to Thursday 8am to 6pm; Friday 8am to 1...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>512-972-5790</td>\n",
       "      <td>NaN</td>\n",
       "      <td>BNC</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Neighborhood Center, Offices</td>\n",
       "      <td>347.0</td>\n",
       "      <td>1984.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>Dove Springs WIC Center</td>\n",
       "      <td>6801 South IH-35, Suite I &amp; J\\nAustin, Texas 7...</td>\n",
       "      <td>78744</td>\n",
       "      <td>Monday and Tuesday 7:30am to 7:00pm, closed 12...</td>\n",
       "      <td>http://www.austintexas.gov/department/dove-spr...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>DOV</td>\n",
       "      <td>Lease</td>\n",
       "      <td>LX-Northbluff Center, L.P.</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>2100.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>First Workers Day Labor Center</td>\n",
       "      <td>4916 N IH 35\\nAustin, Texas 78751\\n(30.308436,...</td>\n",
       "      <td>78751</td>\n",
       "      <td>NaN</td>\n",
       "      <td>http://www.austintexas.gov/online-form/first-w...</td>\n",
       "      <td>512-972-4100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Lease</td>\n",
       "      <td>Najib Webbe</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Service Center</td>\n",
       "      <td>5315.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>11</td>\n",
       "      <td>South Austin Neighborhood Center</td>\n",
       "      <td>2508 Durwood St.\\nAustin, Texas 78704\\n(30.239...</td>\n",
       "      <td>78704</td>\n",
       "      <td>Monday to Thursday 8 a.m. to 6 p.m.; Friday 8 ...</td>\n",
       "      <td>http://www.austintexas.gov/department/south-au...</td>\n",
       "      <td>512-972-6840</td>\n",
       "      <td>NaN</td>\n",
       "      <td>SAN</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Services</td>\n",
       "      <td>18651.0</td>\n",
       "      <td>1980.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>12</td>\n",
       "      <td>Far South WIC Clinic</td>\n",
       "      <td>405 W. Stassney Lane\\nAustin, Texas 78745\\n(30...</td>\n",
       "      <td>78745</td>\n",
       "      <td>Monday and Tuesday 7:30am to 7:00pm, closed 12...</td>\n",
       "      <td>http://www.austintexas.gov/department/far-sout...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>FSH</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Comunity Services, Disease Prevention and Heal...</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>4750.0</td>\n",
       "      <td>1982.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>13</td>\n",
       "      <td>Montopolis WIC Clinic</td>\n",
       "      <td>2901 Montopolis Drive\\nAustin, Texas 78741\\n(3...</td>\n",
       "      <td>78741</td>\n",
       "      <td>Monday and Tuesday 8am to 7pm, closed 12 noon ...</td>\n",
       "      <td>http://www.austintexas.gov/department/montopol...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>MON</td>\n",
       "      <td>Lease</td>\n",
       "      <td>Central</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>1993.0</td>\n",
       "      <td>2015.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>14</td>\n",
       "      <td>Clarksville Community Health Center</td>\n",
       "      <td>1000 Toyath Street\\nAustin, Texas 78703\\n(30.2...</td>\n",
       "      <td>78703</td>\n",
       "      <td>Monday to Friday, 8am - 4:30pm</td>\n",
       "      <td>http://www.austintexas.gov/department/clarksvi...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>CNC</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Disease Prevnetion and Health Promotion</td>\n",
       "      <td>Clinic, Offices</td>\n",
       "      <td>3500.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>15</td>\n",
       "      <td>RBJ Health Center</td>\n",
       "      <td>15 Waller Street\\nAustin, Texas 78702\\n(30.252...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Monday to Friday 8am to 5pm</td>\n",
       "      <td>http://www.austintexas.gov/department/rbj-heal...</td>\n",
       "      <td>512-972-5400</td>\n",
       "      <td>NaN</td>\n",
       "      <td>RBJ</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Administrative Support Services, Disease Prevn...</td>\n",
       "      <td>Clinic, Offices</td>\n",
       "      <td>50809.0</td>\n",
       "      <td>1968.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>16</td>\n",
       "      <td>South Austin WIC Clinic</td>\n",
       "      <td>2508 Durwood St.\\nAustin, Texas 78704\\n(30.239...</td>\n",
       "      <td>78704</td>\n",
       "      <td>Monday and Tuesday 7:30am to 7:00 p.m., closed...</td>\n",
       "      <td>http://www.austintexas.gov/department/south-au...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>SAN</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>18651.0</td>\n",
       "      <td>1980.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>17</td>\n",
       "      <td>Betty Dunkerley Campus, Building E</td>\n",
       "      <td>7201 Levander Loop, Building E\\nAustin, Texas ...</td>\n",
       "      <td>78702</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>512-972-5000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>BDCE</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Administrative Support Services, Health Equity...</td>\n",
       "      <td>Offices</td>\n",
       "      <td>12403.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>18</td>\n",
       "      <td>Montopolis Neighborhood Center</td>\n",
       "      <td>1416 Montopolis Drive\\nAustin, Texas 78741\\n(3...</td>\n",
       "      <td>78741</td>\n",
       "      <td>Tuesday 8am to noon and 1pm to 5pm</td>\n",
       "      <td>http://www.austintexas.gov/department/montopol...</td>\n",
       "      <td>512-962-6650</td>\n",
       "      <td>NaN</td>\n",
       "      <td>MNC</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Neighborhood Center</td>\n",
       "      <td>2840.0</td>\n",
       "      <td>1976.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>19</td>\n",
       "      <td>East Austin WIC Clinic</td>\n",
       "      <td>211 Comal St.\\nAustin, Texas 78702\\n(30.259745...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Monday to Thursday 8am to 6pm; closed 12noon t...</td>\n",
       "      <td>http://www.austintexas.gov/department/east-aus...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>EAN</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>4304.0</td>\n",
       "      <td>1981.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>20</td>\n",
       "      <td>Del Valle WIC Clinic</td>\n",
       "      <td>3518 FM 973\\nDel Valle, Texas 78617\\n(30.19879...</td>\n",
       "      <td>78617</td>\n",
       "      <td>Monday 8am to 7pm; closed 12 noon to 12:30pm; ...</td>\n",
       "      <td>http://www.austintexas.gov/department/del-vall...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>DEL</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Travis County</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>21</td>\n",
       "      <td>Rosewood-Zaragosa Neighborhood Center</td>\n",
       "      <td>2800 Webberville Road\\nAustin, Texas 78702\\n(3...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Monday to Friday 8am to 6pm; Fridays 8am to noon</td>\n",
       "      <td>http://www.austintexas.gov/department/rosewood...</td>\n",
       "      <td>512-972-6740</td>\n",
       "      <td>NaN</td>\n",
       "      <td>RZN</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>17128.0</td>\n",
       "      <td>1974.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>22</td>\n",
       "      <td>Pflugerville WIC Clinic</td>\n",
       "      <td>15822 Foothill Farms Loop\\nPflugerville, Texas...</td>\n",
       "      <td>78660</td>\n",
       "      <td>Monday and Tuesday 7:30am to 7:00pm, closed 12...</td>\n",
       "      <td>http://www.austintexas.gov/department/pflugerv...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>PFL</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Travis County</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>23</td>\n",
       "      <td>Betty Dunkerley Health Campus, Building C</td>\n",
       "      <td>7201 Levander Loop, Bulding C\\nAustin, Texas 7...</td>\n",
       "      <td>78702</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>512-972-5000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>BDCC</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services, Epidemiology, Public Healt...</td>\n",
       "      <td>Offices</td>\n",
       "      <td>7448.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>24</td>\n",
       "      <td>Mom's Place - WIC Breastfeeding Resource Center</td>\n",
       "      <td>8701 Research Blvd., Suite B\\nAustin, Texas 78...</td>\n",
       "      <td>78758</td>\n",
       "      <td>Monday, Wednesday, and Thursday  8am to 5pm, c...</td>\n",
       "      <td>http://www.austintexas.gov/department/moms-pla...</td>\n",
       "      <td>512-719-3010</td>\n",
       "      <td>1-800-514-6667</td>\n",
       "      <td>MOM</td>\n",
       "      <td>Lease</td>\n",
       "      <td>Van Family Real Estate Partnership, Ltd</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>2080.0</td>\n",
       "      <td>1993.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>25</td>\n",
       "      <td>AK Black Health Center</td>\n",
       "      <td>928 Blackson Avenue\\nAustin, Texas 78752\\n(30....</td>\n",
       "      <td>78752</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>512-978-9740</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AKB</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services, Health Equity and Communit...</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>4200.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>26</td>\n",
       "      <td>St. John Community Center</td>\n",
       "      <td>7500 Blessing Avenue\\nAustin, Texas 78752\\n(30...</td>\n",
       "      <td>78752</td>\n",
       "      <td>Monday to Thursday 8 a.m. â 6 p.m.; Friday 8...</td>\n",
       "      <td>http://www.austintexas.gov/department/st-johns...</td>\n",
       "      <td>512-972-5139</td>\n",
       "      <td>NaN</td>\n",
       "      <td>SJC</td>\n",
       "      <td>Lease</td>\n",
       "      <td>Austin Independent School District</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>9559.0</td>\n",
       "      <td>2001.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>27</td>\n",
       "      <td>Elgin WIC Clinic</td>\n",
       "      <td>218 South Main Street\\nElgin, Texas 78621\\n(30...</td>\n",
       "      <td>78621</td>\n",
       "      <td>Tuesdays 8:00am to 5:00pm, closed 12 noon to 1...</td>\n",
       "      <td>http://www.austintexas.gov/department/elgin-wi...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ELG</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Travis County</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>1500.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28</td>\n",
       "      <td>Betty Dunkerley Campus Building H, Administrat...</td>\n",
       "      <td>7201 Levander Loop, Building H\\nAustin, Texas ...</td>\n",
       "      <td>78702</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>BDCH</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Administrative Support Services, Community Ser...</td>\n",
       "      <td>Offices</td>\n",
       "      <td>10016.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>29</td>\n",
       "      <td>Rosewood-Zaragosa WIC Clinic</td>\n",
       "      <td>2800 Webberville Road\\nAustin, Texas 78702\\n(3...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Monday and Tuesday 7:30am to 7:00pm, closed 12...</td>\n",
       "      <td>http://www.austintexas.gov/department/rosewood...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>RZN</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>17128.0</td>\n",
       "      <td>1974.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30</td>\n",
       "      <td>East Austin Neighborhood Center</td>\n",
       "      <td>211 Comal St\\nAustin, Texas 78702\\n(30.259718,...</td>\n",
       "      <td>78702</td>\n",
       "      <td>Monday toThursday 8am to 6pm; Friday 8am to noon</td>\n",
       "      <td>http://www.austintexas.gov/department/east-aus...</td>\n",
       "      <td>512-972-6650</td>\n",
       "      <td>NaN</td>\n",
       "      <td>EAN</td>\n",
       "      <td>Own</td>\n",
       "      <td>City of Austin</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic, Neighborhood Center</td>\n",
       "      <td>4304.0</td>\n",
       "      <td>1981.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>31</td>\n",
       "      <td>Oak Hill WIC Clinic</td>\n",
       "      <td>8656 Hwy. 71 W, Building A Ste B\\nAustin, Texa...</td>\n",
       "      <td>78735</td>\n",
       "      <td>Monday 8am to 5pm, closed 12 noon to 12:30pm</td>\n",
       "      <td>http://www.austintexas.gov/department/oak-hill...</td>\n",
       "      <td>512-972-4942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>OAK</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Travis County</td>\n",
       "      <td>Community Services</td>\n",
       "      <td>Clinic</td>\n",
       "      <td>1200.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        Facility Name  \\\n",
       "0                                  Bastrop WIC Clinic   \n",
       "1                                       Vital Records   \n",
       "2                                    Manor WIC Clinic   \n",
       "3                                St. Johns WIC Clinic   \n",
       "4            Betty Dunkerley Health Campus Building B   \n",
       "5                                Northwest WIC Clinic   \n",
       "6                                   Rutherford Campus   \n",
       "7             Montopolis Recreation Community Center    \n",
       "8                       Blackland Neighborhood Center   \n",
       "9                             Dove Springs WIC Center   \n",
       "10                    First Workers Day Labor Center    \n",
       "11                   South Austin Neighborhood Center   \n",
       "12                               Far South WIC Clinic   \n",
       "13                              Montopolis WIC Clinic   \n",
       "14                Clarksville Community Health Center   \n",
       "15                                 RBJ Health Center    \n",
       "16                            South Austin WIC Clinic   \n",
       "17                Betty Dunkerley Campus, Building E    \n",
       "18                     Montopolis Neighborhood Center   \n",
       "19                             East Austin WIC Clinic   \n",
       "20                               Del Valle WIC Clinic   \n",
       "21              Rosewood-Zaragosa Neighborhood Center   \n",
       "22                            Pflugerville WIC Clinic   \n",
       "23          Betty Dunkerley Health Campus, Building C   \n",
       "24    Mom's Place - WIC Breastfeeding Resource Center   \n",
       "25                            AK Black Health Center    \n",
       "26                          St. John Community Center   \n",
       "27                                   Elgin WIC Clinic   \n",
       "28  Betty Dunkerley Campus Building H, Administrat...   \n",
       "29                       Rosewood-Zaragosa WIC Clinic   \n",
       "30                    East Austin Neighborhood Center   \n",
       "31                                Oak Hill WIC Clinic   \n",
       "\n",
       "                                       Street Address  Zip Code  \\\n",
       "0   443 Texas Highway 71\\nBastrop, Texas 78602\\n(3...     78602   \n",
       "1   7201 Levander Loop, Building C\\nAustin, Texas\\...     78702   \n",
       "2   600 West Carrie\\nManor, Texas 78653\\n(30.34016...     78653   \n",
       "3   7500 Blessing Avenue\\nAustin, Texas 78752\\n(30...     78752   \n",
       "4   7201 Levander Loop\\nAustin, Texas 78702\\n(30.2...     78702   \n",
       "5   8701 Research Blvd, Suite A\\nAustin, Texas 787...     78758   \n",
       "6   1520 Rutherford Lane, Bldg 1\\nAustin, Texas 78...     78754   \n",
       "7   1200 Montopolis Dr.\\nAustin, Texas 78741\\n(30....     78741   \n",
       "8   2005 Salina St\\nAustin, Texas 78722\\n(30.28075...     78722   \n",
       "9   6801 South IH-35, Suite I & J\\nAustin, Texas 7...     78744   \n",
       "10  4916 N IH 35\\nAustin, Texas 78751\\n(30.308436,...     78751   \n",
       "11  2508 Durwood St.\\nAustin, Texas 78704\\n(30.239...     78704   \n",
       "12  405 W. Stassney Lane\\nAustin, Texas 78745\\n(30...     78745   \n",
       "13  2901 Montopolis Drive\\nAustin, Texas 78741\\n(3...     78741   \n",
       "14  1000 Toyath Street\\nAustin, Texas 78703\\n(30.2...     78703   \n",
       "15  15 Waller Street\\nAustin, Texas 78702\\n(30.252...     78702   \n",
       "16  2508 Durwood St.\\nAustin, Texas 78704\\n(30.239...     78704   \n",
       "17  7201 Levander Loop, Building E\\nAustin, Texas ...     78702   \n",
       "18  1416 Montopolis Drive\\nAustin, Texas 78741\\n(3...     78741   \n",
       "19  211 Comal St.\\nAustin, Texas 78702\\n(30.259745...     78702   \n",
       "20  3518 FM 973\\nDel Valle, Texas 78617\\n(30.19879...     78617   \n",
       "21  2800 Webberville Road\\nAustin, Texas 78702\\n(3...     78702   \n",
       "22  15822 Foothill Farms Loop\\nPflugerville, Texas...     78660   \n",
       "23  7201 Levander Loop, Bulding C\\nAustin, Texas 7...     78702   \n",
       "24  8701 Research Blvd., Suite B\\nAustin, Texas 78...     78758   \n",
       "25  928 Blackson Avenue\\nAustin, Texas 78752\\n(30....     78752   \n",
       "26  7500 Blessing Avenue\\nAustin, Texas 78752\\n(30...     78752   \n",
       "27  218 South Main Street\\nElgin, Texas 78621\\n(30...     78621   \n",
       "28  7201 Levander Loop, Building H\\nAustin, Texas ...     78702   \n",
       "29  2800 Webberville Road\\nAustin, Texas 78702\\n(3...     78702   \n",
       "30  211 Comal St\\nAustin, Texas 78702\\n(30.259718,...     78702   \n",
       "31  8656 Hwy. 71 W, Building A Ste B\\nAustin, Texa...     78735   \n",
       "\n",
       "                                                Hours  \\\n",
       "0   Monday 7:30am to 7pm, closed 12 noon to 1pm; T...   \n",
       "1                     Monday to Friday, 8am to 4:30pm   \n",
       "2   Thursday 9am to 2:30pm, closed 12 noon to 12:30pm   \n",
       "3   Monday and Tuesday 7:30 a.m. to 7 p.m., closed...   \n",
       "4                  Sunday - Saturday 7:00am to 7:00pm   \n",
       "5   Monday and Tuesday 7:30am to 7:00pm, closed 12...   \n",
       "6   Monday and Wednesday 7:45am to 11:30am; Tuesda...   \n",
       "7   Monday - Thursday: 11 AM - 9 PM, Friday 11 AM ...   \n",
       "8   Monday to Thursday 8am to 6pm; Friday 8am to 1...   \n",
       "9   Monday and Tuesday 7:30am to 7:00pm, closed 12...   \n",
       "10                                                NaN   \n",
       "11  Monday to Thursday 8 a.m. to 6 p.m.; Friday 8 ...   \n",
       "12  Monday and Tuesday 7:30am to 7:00pm, closed 12...   \n",
       "13  Monday and Tuesday 8am to 7pm, closed 12 noon ...   \n",
       "14                     Monday to Friday, 8am - 4:30pm   \n",
       "15                        Monday to Friday 8am to 5pm   \n",
       "16  Monday and Tuesday 7:30am to 7:00 p.m., closed...   \n",
       "17                                                NaN   \n",
       "18                 Tuesday 8am to noon and 1pm to 5pm   \n",
       "19  Monday to Thursday 8am to 6pm; closed 12noon t...   \n",
       "20  Monday 8am to 7pm; closed 12 noon to 12:30pm; ...   \n",
       "21   Monday to Friday 8am to 6pm; Fridays 8am to noon   \n",
       "22  Monday and Tuesday 7:30am to 7:00pm, closed 12...   \n",
       "23                                                NaN   \n",
       "24  Monday, Wednesday, and Thursday  8am to 5pm, c...   \n",
       "25                                                NaN   \n",
       "26  Monday to Thursday 8 a.m. â 6 p.m.; Friday 8...   \n",
       "27  Tuesdays 8:00am to 5:00pm, closed 12 noon to 1...   \n",
       "28                                                NaN   \n",
       "29  Monday and Tuesday 7:30am to 7:00pm, closed 12...   \n",
       "30   Monday toThursday 8am to 6pm; Friday 8am to noon   \n",
       "31       Monday 8am to 5pm, closed 12 noon to 12:30pm   \n",
       "\n",
       "                                              Website  Phone Number  \\\n",
       "0                                                 NaN  512-972-4942   \n",
       "1           https://austintexas.gov/birthcertificates  512-972-4784   \n",
       "2   http://www.austintexas.gov/department/manor-wi...  512-972-4942   \n",
       "3   http://www.austintexas.gov/department/st-johns...  512-972-4942   \n",
       "4                                                 NaN  512-972-5010   \n",
       "5   http://www.austintexas.gov/department/northwes...  512-972-4942   \n",
       "6   https://austintexas.gov/department/environment...  512-978-0300   \n",
       "7                                                 NaN   12-978-2300   \n",
       "8                                                 NaN  512-972-5790   \n",
       "9   http://www.austintexas.gov/department/dove-spr...  512-972-4942   \n",
       "10  http://www.austintexas.gov/online-form/first-w...  512-972-4100   \n",
       "11  http://www.austintexas.gov/department/south-au...  512-972-6840   \n",
       "12  http://www.austintexas.gov/department/far-sout...  512-972-4942   \n",
       "13  http://www.austintexas.gov/department/montopol...  512-972-4942   \n",
       "14  http://www.austintexas.gov/department/clarksvi...           NaN   \n",
       "15  http://www.austintexas.gov/department/rbj-heal...  512-972-5400   \n",
       "16  http://www.austintexas.gov/department/south-au...  512-972-4942   \n",
       "17                                                NaN  512-972-5000   \n",
       "18  http://www.austintexas.gov/department/montopol...  512-962-6650   \n",
       "19  http://www.austintexas.gov/department/east-aus...  512-972-4942   \n",
       "20  http://www.austintexas.gov/department/del-vall...  512-972-4942   \n",
       "21  http://www.austintexas.gov/department/rosewood...  512-972-6740   \n",
       "22  http://www.austintexas.gov/department/pflugerv...  512-972-4942   \n",
       "23                                                NaN  512-972-5000   \n",
       "24  http://www.austintexas.gov/department/moms-pla...  512-719-3010   \n",
       "25                                                NaN  512-978-9740   \n",
       "26  http://www.austintexas.gov/department/st-johns...  512-972-5139   \n",
       "27  http://www.austintexas.gov/department/elgin-wi...  512-972-4942   \n",
       "28                                                NaN           NaN   \n",
       "29  http://www.austintexas.gov/department/rosewood...  512-972-4942   \n",
       "30  http://www.austintexas.gov/department/east-aus...  512-972-6650   \n",
       "31  http://www.austintexas.gov/department/oak-hill...  512-972-4942   \n",
       "\n",
       "       Other Phone Building ID Ownership Status  \\\n",
       "0              NaN         BAS            Lease   \n",
       "1              NaN         NaN              NaN   \n",
       "2              NaN         MAN              NaN   \n",
       "3              NaN         SJC            Lease   \n",
       "4              NaN        BDCB              Own   \n",
       "5              NaN         NWW            Lease   \n",
       "6              NaN         RLC              Own   \n",
       "7              NaN       MRCC              Own    \n",
       "8              NaN         BNC              Own   \n",
       "9              NaN         DOV            Lease   \n",
       "10             NaN         NaN            Lease   \n",
       "11             NaN        SAN               Own   \n",
       "12             NaN         FSH              Own   \n",
       "13             NaN         MON            Lease   \n",
       "14             NaN         CNC              Own   \n",
       "15             NaN         RBJ              Own   \n",
       "16             NaN        SAN               Own   \n",
       "17             NaN        BDCE             Own    \n",
       "18             NaN         MNC              Own   \n",
       "19             NaN         EAN              Own   \n",
       "20             NaN         DEL              NaN   \n",
       "21             NaN         RZN              Own   \n",
       "22             NaN         PFL              NaN   \n",
       "23             NaN        BDCC             Own    \n",
       "24  1-800-514-6667         MOM            Lease   \n",
       "25             NaN         AKB              Own   \n",
       "26             NaN         SJC            Lease   \n",
       "27             NaN         ELG              NaN   \n",
       "28             NaN        BDCH             Own    \n",
       "29             NaN         RZN              Own   \n",
       "30             NaN         EAN              Own   \n",
       "31             NaN         OAK              NaN   \n",
       "\n",
       "                                      Owner  \\\n",
       "0                The Marketplace at Bastrop   \n",
       "1                                       NaN   \n",
       "2                            Travis County    \n",
       "3         Austin Independent School Center    \n",
       "4                            City of Austin   \n",
       "5   Van Family Real Estate Partnership, Ltd   \n",
       "6                            City of Austin   \n",
       "7                           City of Austin    \n",
       "8                            City of Austin   \n",
       "9                LX-Northbluff Center, L.P.   \n",
       "10                             Najib Webbe    \n",
       "11                           City of Austin   \n",
       "12                           City of Austin   \n",
       "13                                 Central    \n",
       "14                           City of Austin   \n",
       "15                           City of Austin   \n",
       "16                          City of Austin    \n",
       "17                          City of Austin    \n",
       "18                           City of Austin   \n",
       "19                           City of Austin   \n",
       "20                           Travis County    \n",
       "21                           City of Austin   \n",
       "22                           Travis County    \n",
       "23                          City of Austin    \n",
       "24  Van Family Real Estate Partnership, Ltd   \n",
       "25                          City of Austin    \n",
       "26      Austin Independent School District    \n",
       "27                           Travis County    \n",
       "28                           City of Austin   \n",
       "29                           City of Austin   \n",
       "30                           City of Austin   \n",
       "31                           Travis County    \n",
       "\n",
       "                                   Occupying Division  \\\n",
       "0                                 Community Services    \n",
       "1                                                 NaN   \n",
       "2                                 Community Services    \n",
       "3                                 Community Services    \n",
       "4   Epidemiology and Public Health Preparedness, O...   \n",
       "5                                 Community Services    \n",
       "6                      Environmental Health Services    \n",
       "7                                 Community Services    \n",
       "8                                  Community Services   \n",
       "9                                 Community Services    \n",
       "10                                Community Services    \n",
       "11                                Community Services    \n",
       "12  Comunity Services, Disease Prevention and Heal...   \n",
       "13                                 Community Services   \n",
       "14            Disease Prevnetion and Health Promotion   \n",
       "15  Administrative Support Services, Disease Prevn...   \n",
       "16                                Community Services    \n",
       "17  Administrative Support Services, Health Equity...   \n",
       "18                                Community Services    \n",
       "19                                Community Services    \n",
       "20                                Community Services    \n",
       "21                                Community Services    \n",
       "22                                Community Services    \n",
       "23  Community Services, Epidemiology, Public Healt...   \n",
       "24                                Community Services    \n",
       "25  Community Services, Health Equity and Communit...   \n",
       "26                                Community Services    \n",
       "27                                Community Services    \n",
       "28  Administrative Support Services, Community Ser...   \n",
       "29                                Community Services    \n",
       "30                                Community Services    \n",
       "31                                Community Services    \n",
       "\n",
       "                    Occupancy Type  Sq. Ft.   Year Built   \n",
       "0                           Clinic    1400.0          NaN  \n",
       "1                              NaN       NaN          NaN  \n",
       "2                           Clinic    1700.0          NaN  \n",
       "3     Clinic, Neighborhood Center     9559.0       2001.0  \n",
       "4                         Offices     2190.0          NaN  \n",
       "5                           Clinic    4200.0       1993.0  \n",
       "6                         Offices     2500.0          NaN  \n",
       "7                         Offices        NaN          NaN  \n",
       "8    Neighborhood Center, Offices      347.0       1984.0  \n",
       "9                           Clinic    2100.0          NaN  \n",
       "10                 Service Center     5315.0          NaN  \n",
       "11  Clinic, Neighborhood Services    18651.0       1980.0  \n",
       "12                          Clinic    4750.0       1982.0  \n",
       "13                          Clinic    1993.0       2015.0  \n",
       "14                Clinic, Offices     3500.0          NaN  \n",
       "15                Clinic, Offices    50809.0       1968.0  \n",
       "16    Clinic, Neighborhood Center    18651.0       1980.0  \n",
       "17                        Offices    12403.0          NaN  \n",
       "18            Neighborhood Center     2840.0       1976.0  \n",
       "19    Clinic, Neighborhood Center     4304.0       1981.0  \n",
       "20                         Clinic     1000.0          NaN  \n",
       "21    Clinic, Neighborhood Center    17128.0       1974.0  \n",
       "22                          Clinic    2000.0          NaN  \n",
       "23                         Offices    7448.0          NaN  \n",
       "24                          Clinic    2080.0       1993.0  \n",
       "25                          Clinic    4200.0          NaN  \n",
       "26    Clinic, Neighborhood Center     9559.0       2001.0  \n",
       "27                          Clinic    1500.0          NaN  \n",
       "28                        Offices    10016.0          NaN  \n",
       "29    Clinic, Neighborhood Center    17128.0       1974.0  \n",
       "30    Clinic, Neighborhood Center     4304.0       1981.0  \n",
       "31                          Clinic    1200.0          NaN  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.read_csv(path+'/Austin_Public_Health_Locations.csv')\n",
    "display(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Read the database into a raw text string. \n",
    "This will be our starting point."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Facility Name,Street Address,Zip Code,Hours,Website,Phone Number,Other Phone,Building ID,Ownership Status,Owner,Occupying Division,Occupancy Type,Sq. Ft. ,Year Built Bastrop WIC Clinic,\"443 Texas Highway 71Bastrop, Texas 78602(30.10646853400044, -97.33211573399967)\",78602,\"Monday 7:30am to 7pm, closed 12 noon to 1pm; Tuesday and Friday closed; Wednesday and Thursday 7:30 am to 4:30 pm, closed 12 noon to 12:30 pm (closed second Wednesday of each month); Second Saturday of each month 8am to 12 noon\",,512-972-4942,,BAS,Lease,The Marketplace at Bastrop,Community Services ,Clinic,1400,N/AVital Records,\"7201 Levander Loop, Building CAustin, Texas(30.252329, -97.690404)\",78702,\"Monday to Friday, 8am to 4:30pm\",https://austintexas.gov/birthcertificates,512-972-4784,,,,,,,,Manor WIC Clinic,\"600 West CarrieManor, Texas 78653(30.340164, -97.563744)\",78653,\"Thursday 9am to 2:30pm, closed 12 noon to 12:30pm\",http://www.austintexas.gov/department/manor-wic-clinic,512-972-4942,,MAN,N/A,Travis County ,Community Services ,Clinic,1700,N/ASt. Johns WIC Clinic,\"7500 Blessing AvenueAustin, Texas 78752(30.332635, -97.69335)\",78752,\"Monday and Tuesday 7:30 a.m. to 7 p.m., closed noon to 1 p.m.; Wednesday and Thursdays 7:30 a.m. to 4:30 p.m., closed noon to 12:30 p.m. (Closed second Wednesday of each month); Fridays 7:30am to noon; Second Saturday of each month 8 a.m. to noon\",http://www.austintexas.gov/department/st-johns-wic-clinic,512-972-4942,,SJC,Lease,Austin Independent School Center ,Community Services ,\"Clinic, Neighborhood Center \",9559,2001Betty Dunkerley Health Campus Building B,\"7201 Levander LoopAustin, Texas 78702(30.251305664000483, -97.69174879199966)\",78702,Sunday - Saturday 7:00am to 7:00pm,,512-972-5010,,BDCB,Own,City of Austin,\"Epidemiology and Public Health Preparedness, Office of the Director\",Offices ,2190,N/ANorthwest WIC Clinic,\"8701 Research Blvd, Suite AAustin, Texas 78758(30.365149, -97.716958)\",78758,\"Monday and Tuesday 7:30am to 7:00pm, closed 12 noon to 1:00pm; Wednesday and Thursday 7:30am to 7:00pm, closed 12 noon to 12:30pm (Closed second Wednesday of each month); Fridays 7:30am to 12 noon; Second Saturday of each month 8:00am to 12 noon\",http://www.austintexas.gov/department/northwest-wic-clinic,512-972-4942,,NWW,Lease,\"Van Family Real Estate Partnership, Ltd\",Community Services ,Clinic,4200,1993Rutherford Campus,\"1520 Rutherford Lane, Bldg 1Austin, Texas 78754(30.337078, -97.68114)\",78754,\"Monday and Wednesday 7:45am to 11:30am; Tuesday, Thursday, and Friday 7:45am to 4:30 pm\",https://austintexas.gov/department/environmental-health-services,512-978-0300,,RLC,Own,City of Austin,Environmental Health Services ,Offices ,2500,N/AMontopolis Recreation Community Center ,\"1200 Montopolis Dr.Austin, Texas 78741(30.232386, -97.699893)\",78741,\"Monday - Thursday: 11 AM - 9 PM, Friday 11 AM - 6 PM, Saturday 10 AM - 4 PM, Sunday: Closed \",,12-978-2300,,MRCC ,Own ,City of Austin ,Community Services ,Offices ,,N/ABlackland Neighborhood Center,\"2005 Salina StAustin, Texas 78722(30.280750365000472, -97.72245940699969)\",78722,Monday to Thursday 8am to 6pm; Friday 8am to 12noon,,512-972-5790,,BNC,Own,City of Austin,Community Services,\"Neighborhood Center, Offices \",347,1984Dove Springs WIC Center,\"6801 South IH-35, Suite I & JAustin, Texas 78744(30.187722, -97.770861)\",78744,\"Monday and Tuesday 7:30am to 7:00pm, closed 12 noon to 1:00pm; Wednesday and Thursday 7:30am to 4:30pm, closed 12 noon to 12:30pm; Closed second Wednesday of each month; Friday 7:30am to 12 noon; Second Saturday of each month 8:00am to 12 noon\",http://www.austintexas.gov/department/dove-springs-wic-center,512-972-4942,,DOV,Lease,\"LX-Northbluff Center, L.P.\",Community Services ,Clinic,2100,N/AFirst Workers Day Labor Center ,\"4916 N IH 35Austin, Texas 78751(30.308436, -97.711863)\",78751,,http://www.austintexas.gov/online-form/first-workers-day-labor-job-request,512-972-4100,,,Lease,Najib Webbe ,Community Services ,Service Center ,5315,N/ASouth Austin Neighborhood Center,\"2508 Durwood St.Austin, Texas 78704(30.239254, -97.760064)\",78704,Monday to Thursday 8 a.m. to 6 p.m.; Friday 8 a.m. to noon,http://www.austintexas.gov/department/south-austin-neighborhood-center,512-972-6840,,SAN ,Own,City of Austin,Community Services ,\"Clinic, Neighborhood Services \",18651,1980Far South WIC Clinic,\"405 W. Stassney LaneAustin, Texas 78745(30.20701, -97.779239)\",78745,\"Monday and Tuesday 7:30am to 7:00pm, closed 12 noon to 1:00pm; Wednesday and Thursday 7:30am to 4:30pm, closed 12 noon to 12:30pm (Closed second Wednesday of each month); Fridays 7:30am to 12 noon; Second Saturday of each month 8:00am to 12 noon\",http://www.austintexas.gov/department/far-south-wic-clinic,512-972-4942,,FSH,Own,City of Austin,\"Comunity Services, Disease Prevention and Health Promotion\",Clinic,4750,1982Montopolis WIC Clinic,\"2901 Montopolis DriveAustin, Texas 78741(30.214991, -97.708833)\",78741,\"Monday and Tuesday 8am to 7pm, closed 12 noon to 1:00pm; Wednesday and Thursday 8am to 4:30pm, closed 12 noon to 12:30pm; Closed second Wednesday of each month; Friday 8am to 12 noon; Second Saturday of each month 8:00am to 12 noon\",http://www.austintexas.gov/department/montopolis-wic-clinic,512-972-4942,,MON,Lease,Central ,Community Services,Clinic,1993,2015Clarksville Community Health Center,\"1000 Toyath StreetAustin, Texas 78703(30.28122053000044, -97.76330054699969)\",78703,\"Monday to Friday, 8am - 4:30pm\",http://www.austintexas.gov/department/clarksville-community-health-center,,,CNC,Own,City of Austin,Disease Prevnetion and Health Promotion,\"Clinic, Offices \",3500,N/ARBJ Health Center ,\"15 Waller StreetAustin, Texas 78702(30.25231, -97.733446)\",78702,Monday to Friday 8am to 5pm,http://www.austintexas.gov/department/rbj-health-center,512-972-5400,,RBJ,Own,City of Austin,\"Administrative Support Services, Disease Prevnetion and Health Promotion, Epidemiology, Public Health Preparedness\",\"Clinic, Offices \",50809,1968South Austin WIC Clinic,\"2508 Durwood St.Austin, Texas 78704(30.239252, -97.760073)\",78704,\"Monday and Tuesday 7:30am to 7:00 p.m., closed noon to 1:00 p.m.; Wednesday and Thursday 7:30am to 4:30 pm, closed noon to 12:30 p.m.; (Closed second Wednesday of each month); Friday 7:30am to noon; Second Saturday of each month 8:00am to noon\",http://www.austintexas.gov/department/south-austin-wic-clinic,512-972-4942,,SAN ,Own,City of Austin ,Community Services ,\"Clinic, Neighborhood Center \",18651,1980\"Betty Dunkerley Campus, Building E \",\"7201 Levander Loop, Building EAustin, Texas 78702(30.252944, -97.690225)\",78702,,,512-972-5000,,BDCE,Own ,City of Austin ,\"Administrative Support Services, Health Equity and Community Engagement, Office of the Director \",Offices ,12403,N/AMontopolis Neighborhood Center,\"1416 Montopolis DriveAustin, Texas 78741(30.229149, -97.701342)\",78741,Tuesday 8am to noon and 1pm to 5pm,http://www.austintexas.gov/department/montopolis-neighborhood-center,512-962-6650,,MNC,Own,City of Austin,Community Services ,Neighborhood Center ,2840,1976East Austin WIC Clinic,\"211 Comal St.Austin, Texas 78702(30.259745, -97.727356)\",78702,Monday to Thursday 8am to 6pm; closed 12noon to 1pm; Friday 8am to 12noon,http://www.austintexas.gov/department/east-austin-wic-clinic,512-972-4942,,EAN,Own,City of Austin,Community Services ,\"Clinic, Neighborhood Center \",4304,1981Del Valle WIC Clinic,\"3518 FM 973Del Valle, Texas 78617(30.198796, -97.642069)\",78617,\"Monday 8am to 7pm; closed 12 noon to 12:30pm; First and third Thursday of each month 8am to 4:30 pm, closed 12 noon to 12:30pm\",http://www.austintexas.gov/department/del-valle-wic-clinic,512-972-4942,,DEL,N/A,Travis County ,Community Services ,Clinic ,1000,N/ARosewood-Zaragosa Neighborhood Center,\"2800 Webberville RoadAustin, Texas 78702(30.265355, -97.710555)\",78702,Monday to Friday 8am to 6pm; Fridays 8am to noon,http://www.austintexas.gov/department/rosewood-zaragosa-neighborhood-center,512-972-6740,,RZN,Own,City of Austin,Community Services ,\"Clinic, Neighborhood Center \",17128,1974Pflugerville WIC Clinic,\"15822 Foothill Farms LoopPflugerville, Texas 78660(30.449001, -97.65186)\",78660,\"Monday and Tuesday 7:30am to 7:00pm, closed 12 noon to 1:00pm; Wednesday and Thursday 7:30am to 4:30pm, closed 12 noon to 12:30pm (Closed second Wednesday of each month); Friday 7:30am to 12 noon; Second Saturday of each month 8:00am to 12 noon\",http://www.austintexas.gov/department/pflugerville-wic-clinic,512-972-4942,,PFL,N/A,Travis County ,Community Services ,Clinic,2000,N/A\"Betty Dunkerley Health Campus, Building C\",\"7201 Levander Loop, Bulding CAustin, Texas 78702(30.251614, -97.690013)\",78702,,,512-972-5000,,BDCC,Own ,City of Austin ,\"Community Services, Epidemiology, Public Health Preparedness \",Offices,7448,N/AMom's Place - WIC Breastfeeding Resource Center,\"8701 Research Blvd., Suite BAustin, Texas 78758(30.364895, -97.71704)\",78758,\"Monday, Wednesday, and Thursday  8am to 5pm, closed 12:15pm to 12:45pm (Closed 2nd Wednesday of each month); Tuesday 8am to 6pm, closed 12:15pm to 12:45pm; Friday 8am to 2pm\",http://www.austintexas.gov/department/moms-place-wic-breastfeeding-resource-center,512-719-3010,1-800-514-6667,MOM,Lease,\"Van Family Real Estate Partnership, Ltd\",Community Services ,Clinic,2080,1993AK Black Health Center ,\"928 Blackson AvenueAustin, Texas 78752(30.333683, -97.698535)\",78752,,,512-978-9740,,AKB,Own,City of Austin ,\"Community Services, Health Equity and Community Engagement\",Clinic,4200,N/ASt. John Community Center,\"7500 Blessing AvenueAustin, Texas 78752(30.332632, -97.693348)\",78752,Monday to Thursday 8 a.m. Ã¢Â€Â“ 6 p.m.; Friday 8 a.m. to noon,http://www.austintexas.gov/department/st-johns-community-center,512-972-5139,,SJC,Lease,Austin Independent School District ,Community Services ,\"Clinic, Neighborhood Center \",9559,2001Elgin WIC Clinic,\"218 South Main StreetElgin, Texas 78621(30.345313, -97.369808)\",78621,\"Tuesdays 8:00am to 5:00pm, closed 12 noon to 12:30pm; Fridays 8:00am to 12:00pm\",http://www.austintexas.gov/department/elgin-wic-clinic,512-972-4942,,ELG,N/A,Travis County ,Community Services ,Clinic,1500,N/A\"Betty Dunkerley Campus Building H, Administrative Services \",\"7201 Levander Loop, Building HAustin, Texas 78702(30.253738, -97.689104)\",78702,,,,,BDCH,Own ,City of Austin,\"Administrative Support Services, Community Services, Health Equity and Community Engagement \",Offices ,10016,N/ARosewood-Zaragosa WIC Clinic,\"2800 Webberville RoadAustin, Texas 78702(30.265487, -97.71038)\",78702,\"Monday and Tuesday 7:30am to 7:00pm, closed 12 noon to 1:00p.m.; Wednesday and Thursday 7:30am to 4:30 pm, closed 12:00 noon to 12:30pm (Closed second Wednesday of each month); Friday 7:30am to 12:00 noon; Second Saturday of each month 8:00am to 12:00 noon\",http://www.austintexas.gov/department/rosewood-zaragosa-wic-clinic,512-972-4942,,RZN,Own,City of Austin,Community Services ,\"Clinic, Neighborhood Center \",17128,1974East Austin Neighborhood Center,\"211 Comal StAustin, Texas 78702(30.259718, -97.727464)\",78702,Monday toThursday 8am to 6pm; Friday 8am to noon,http://www.austintexas.gov/department/east-austin-neighborhood-center,512-972-6650,,EAN,Own,City of Austin,Community Services ,\"Clinic, Neighborhood Center \",4304,1981Oak Hill WIC Clinic,\"8656 Hwy. 71 W, Building A Ste BAustin, Texas 78735(30.251475, -97.893723)\",78735,\"Monday 8am to 5pm, closed 12 noon to 12:30pm\",http://www.austintexas.gov/department/oak-hill-wic-clinic,512-972-4942,,OAK,N/A,Travis County ,Community Services ,Clinic,1200,N/A\n"
     ]
    }
   ],
   "source": [
    "with open(path+'/Austin_Public_Health_Locations.csv', 'r') as file:\n",
    "    data = file.read().replace('\\n', '')\n",
    "print(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. Extract the phone numbers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### We first construct a regular expression to match the phone numbers and break them into tuples. This involved a bit of trial and error."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "re_extract_phone_number = re.compile(r\"(\\d\\d\\d)-(\\d+)-(\\d+)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('512', '972', '4942'),\n",
       " ('512', '972', '4784'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '5010'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '978', '0300'),\n",
       " ('512', '972', '5790'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '4100'),\n",
       " ('512', '972', '6840'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '5400'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '5000'),\n",
       " ('512', '962', '6650'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '6740'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '5000'),\n",
       " ('512', '719', '3010'),\n",
       " ('800', '514', '6667'),\n",
       " ('512', '978', '9740'),\n",
       " ('512', '972', '5139'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '4942'),\n",
       " ('512', '972', '6650'),\n",
       " ('512', '972', '4942')]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "phone_number_list = re_extract_phone_number.findall(data)\n",
    "display(phone_number_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3. Put the phone numbers in the desired format"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Next we join together the tuples, separated by spaces:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['512 972 4942',\n",
       " '512 972 4784',\n",
       " '512 972 4942',\n",
       " '512 972 4942',\n",
       " '512 972 5010',\n",
       " '512 972 4942',\n",
       " '512 978 0300',\n",
       " '512 972 5790',\n",
       " '512 972 4942',\n",
       " '512 972 4100',\n",
       " '512 972 6840',\n",
       " '512 972 4942',\n",
       " '512 972 4942',\n",
       " '512 972 5400',\n",
       " '512 972 4942',\n",
       " '512 972 5000',\n",
       " '512 962 6650',\n",
       " '512 972 4942',\n",
       " '512 972 4942',\n",
       " '512 972 6740',\n",
       " '512 972 4942',\n",
       " '512 972 5000',\n",
       " '512 719 3010',\n",
       " '800 514 6667',\n",
       " '512 978 9740',\n",
       " '512 972 5139',\n",
       " '512 972 4942',\n",
       " '512 972 4942',\n",
       " '512 972 6650',\n",
       " '512 972 4942']"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[' '.join(tuple) for tuple in phone_number_list]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Voila! Finis."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "fastai_v1",
   "language": "python",
   "name": "fastai_v1"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
